package com.atguigu.guli.service.vod.controller.api;

import com.atguigu.guli.service.base.result.R;
import com.atguigu.guli.service.vod.service.MediaService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

@RestController

@RequestMapping("/api/vod/media")
public class ApiMediaController {

    @Autowired
    MediaService mediaService;

    //2、获取视频的播放地址(以后基本不用，因为视频都是加密提交)
    @GetMapping("getPlayUrl/{videoId}")
    public R getPlayUrl(@PathVariable String videoId){
        String playUrl = mediaService.getPlayUrl(videoId);
        return R.ok().data("playUrl" , playUrl);
    }
    //3、获取加密视频的播放凭证
    @GetMapping("getPlayAuth/{videoId}")
    public R getPlayAuth(@PathVariable String videoId){
        String playAuth = mediaService.getPlayAuth(videoId);
        return R.ok().data("playAuth" , playAuth);
    }
}
